let request = require("./request")
let {
  findAllUrl,
  addmarkerUrl,
  findCircleUrl,
  findByIdUrl,
  code2sessionUrl,
  getUserInfoUrl,
  findByUserUrl,
  findPointByUserUrl,
  updateShareUrl,
  updatePointUrl,
  deletePointUrl
} = require("./backend")
export const findAll = (data) => {
  return request(findAllUrl, "GET", data)
}

export const addMarker = (data) => {
  return request(addmarkerUrl, "POST", data)
}

export const findCircle = (data) => {
  return request(findCircleUrl, "GET", data)
}

export const findById = (data) => {
  return request(findByIdUrl, "GET", data)
}

export const code2session = (data) => {
  return request(code2sessionUrl, "GET", data)
}

export const getUserInfo = (data) => {
  return request(getUserInfoUrl, "GET", data)
}
export const findByUser = (data) => {
  return request(findByUserUrl, "GET", data)
}
export const findPointByUser = (data) => {
  return request(findPointByUserUrl, "GET", data)
}

export const updateShare = (data) => {
  return request(updateShareUrl, "POST", data)
}

export const updatePoint = (data) => {
  return request(updatePointUrl, "POST", data)
}

export const deletePoint = (id) => {
  return request(deletePointUrl+`/${id}`, "DELETE", {})
}